package dao

import (
	"main/model"
	"main/tool"
)

type FoodCategoryDao struct {
	*tool.OrmEngine
}

func NewFoodCategoryDao() *FoodCategoryDao {
	return &FoodCategoryDao{
		OrmEngine: tool.DbEngine,
	}
}

// 查询所有数据
func (fcd *FoodCategoryDao) QueryCategories() ([]model.FoodCategory, error) {
	var categories []model.FoodCategory
	if err := fcd.Find(&categories); err != nil {
		return nil, err
	}
	return categories, nil
}




